package br.com.sgc.dao;

import javax.ejb.Stateless;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import br.com.sgc.entities.geral.PacienteAnimal;


@Stateless
public class PacienteAnimalDao extends GenericDao<PacienteAnimal> {

	private static final long serialVersionUID = -6378397992416466972L;

	public PacienteAnimal findPacienteByAnimalId(Long id) {
		Criteria criteria = getCriteria(PacienteAnimal.class);
		criteria.add(Restrictions.eq("animal.id", id));
		return (PacienteAnimal) criteria.uniqueResult();
	}
	
	

}
